package com.example.administrator.himalaya.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;

/**
 * Created by Administrator on 2016/12/8.
 */

public class SubscibeAdapter extends FragmentPagerAdapter{
    private List<String> title;
    private List<Fragment> fragments;
    private Context context;

    public SubscibeAdapter(FragmentManager fm,List<String> title,List<Fragment> fragments,Context context) {
        super(fm);
        this.title =title;
        this.fragments =fragments;
        this.context =context;
    }
    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments==null?0:fragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return title.get(position);
    }
}
